<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BadgerDB: /home/ubuntu/study/dbmslab/lab2/BufMgr/src/buffer.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BadgerDB
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.html">home</a></li><li class="navelem"><a class="el" href="dir_f895279abf3c9abddbac24b9a320b4c6.html">ubuntu</a></li><li class="navelem"><a class="el" href="dir_9223221a80e1dde112a2f0d1c0d6bc8d.html">study</a></li><li class="navelem"><a class="el" href="dir_565d95caf30f979632cef261ad9a6ed4.html">dbmslab</a></li><li class="navelem"><a class="el" href="dir_04bc7b587b42191e49c8f970037360ad.html">lab2</a></li><li class="navelem"><a class="el" href="dir_ccc57109e70d5b9b219c75d9ecb5bc70.html">BufMgr</a></li><li class="navelem"><a class="el" href="dir_57419356550b183f8cb4d89f81ab51b6.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">buffer.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;buffer.h&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;exceptions/buffer_exceeded_exception.h&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;exceptions/page_not_pinned_exception.h&quot;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;exceptions/page_pinned_exception.h&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;exceptions/bad_buffer_exception.h&quot;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;exceptions/hash_not_found_exception.h&quot;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="namespacebadgerdb.html">   17</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacebadgerdb.html">badgerdb</a></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#a18b7cf23b619c7c0e593d1dc45da77b4">   20</a></span>&#160;  <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a18b7cf23b619c7c0e593d1dc45da77b4">BufMgr::BufMgr</a>(std::uint32_t bufs)</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    : numBufs(bufs)</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;  {</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    bufDescTable = <span class="keyword">new</span> <a class="code" href="classbadgerdb_1_1_buf_desc.html">BufDesc</a>[bufs];</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keywordflow">for</span> (<a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> i = 0; i &lt; bufs; i++)</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    {</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;      bufDescTable[i].frameNo = i;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;      bufDescTable[i].valid = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    }</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a> = <span class="keyword">new</span> <a class="code" href="classbadgerdb_1_1_page.html">Page</a>[bufs];</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordtype">int</span> htsize = ((((int)(bufs * 1.2)) * 2) / 2) + 1;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    hashTable = <span class="keyword">new</span> <a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html">BufHashTbl</a>(htsize); <span class="comment">// allocate the buffer hash table</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    clockHand = bufs - 1;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;  }</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#aab08001e1be18bfbd4af9113e91cf953">   39</a></span>&#160;  <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aab08001e1be18bfbd4af9113e91cf953">BufMgr::~BufMgr</a>()</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  {</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <a class="code" href="classbadgerdb_1_1_buf_desc.html">BufDesc</a> *tmpbuf;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keywordflow">for</span> (std::uint32_t i = 0; i &lt; numBufs; i++)</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    {</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;      tmpbuf = &amp;(bufDescTable[i]);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;      <span class="keywordflow">if</span> (tmpbuf-&gt;dirty)</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        tmpbuf-&gt;file-&gt;writePage(<a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[tmpbuf-&gt;pageNo]);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    }</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keyword">delete</span> hashTable;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keyword">delete</span>[] <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keyword">delete</span>[] bufDescTable;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  }</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  <span class="keywordtype">void</span> BufMgr::advanceClock()</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;  {</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    clockHand = (clockHand + 1) % numBufs;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  }</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  <span class="keywordtype">void</span> BufMgr::allocBuf(<a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> &amp;frame)</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;  {</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    std::uint32_t count = 0;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">while</span> (<span class="keyword">true</span>)</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    {</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;      advanceClock();</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;      <span class="comment">//有效</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;      <span class="keywordflow">if</span> (!bufDescTable[clockHand].valid)</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;      {</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        frame = clockHand;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;      }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;      <span class="keywordflow">if</span> (bufDescTable[clockHand].pinCnt)</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;      {</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        bufDescTable[clockHand].refbit = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        count++;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <span class="comment">//全部pin住</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="keywordflow">if</span> (count == numBufs)</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;          <span class="keywordflow">throw</span> BufferExceededException();</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;          <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;      }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;      <span class="keywordflow">if</span> (bufDescTable[clockHand].refbit)</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      {</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        bufDescTable[clockHand].refbit = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;      }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;      <span class="keywordflow">if</span> (bufDescTable[clockHand].dirty)</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;      {</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        bufDescTable[clockHand].file-&gt;<a class="code" href="classbadgerdb_1_1_file.html#a9a1b3cc43c4631bde58c1c4f670e1036">writePage</a>(<a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[clockHand]);</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        bufDescTable[clockHand].dirty = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;      }</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;      <span class="keywordflow">try</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;      {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        <a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> frameNo;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a23b1030dd244d0d956176a596aae0210">lookup</a>(bufDescTable[clockHand].file, bufDescTable[clockHand].pageNo, frameNo);</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a5739cc2b22c74d62e25c9d3d316144d8">remove</a>(bufDescTable[clockHand].file, bufDescTable[clockHand].pageNo);</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;      }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;      <span class="keywordflow">catch</span> (HashNotFoundException &amp;e)</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;      {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;      }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;      frame = clockHand;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;      <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    }</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#a9f853f0f1d4628e7e14374d0c7c6a4f3">  109</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a9f853f0f1d4628e7e14374d0c7c6a4f3">BufMgr::readPage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a> *file, <span class="keyword">const</span> <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> pageNo, <a class="code" href="classbadgerdb_1_1_page.html">Page</a> *&amp;page)</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  {</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> frameNo;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordflow">try</span></div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    {</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;      hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a23b1030dd244d0d956176a596aae0210">lookup</a>(file, pageNo, frameNo);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;      bufDescTable[frameNo].refbit = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;      bufDescTable[frameNo].pinCnt++;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;      page = &amp;(<a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[frameNo]);</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    }</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordflow">catch</span> (<a class="code" href="classbadgerdb_1_1_hash_not_found_exception.html">HashNotFoundException</a> &amp;e)</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    {</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;      allocBuf(frameNo);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;      <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[frameNo] = file-&gt;<a class="code" href="classbadgerdb_1_1_file.html#a343b7fb1a238992f02454e9e81837acd">readPage</a>(pageNo);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;      page = &amp;(<a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[frameNo]);</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;      hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a92480d460ddb07e8b04ab7f99107e334">insert</a>(file, pageNo, frameNo);</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;      bufDescTable[frameNo].Set(file, pageNo);</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    }</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  }</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#aa9bdf04c8543f59744db22efa9420c89">  129</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa9bdf04c8543f59744db22efa9420c89">BufMgr::unPinPage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a> *file, <span class="keyword">const</span> <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> pageNo, <span class="keyword">const</span> <span class="keywordtype">bool</span> dirty)</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  {</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> frameNo;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">try</span></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a23b1030dd244d0d956176a596aae0210">lookup</a>(file, pageNo, frameNo);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;      <span class="keywordflow">if</span> (!bufDescTable[frameNo].pinCnt)</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="classbadgerdb_1_1_page_not_pinned_exception.html">PageNotPinnedException</a>(bufDescTable[frameNo].file-&gt;<a class="code" href="classbadgerdb_1_1_file.html#af16040a60f18c99305348077ac9e8aa8">filename</a>(), bufDescTable[frameNo].pageNo, frameNo);</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;      bufDescTable[frameNo].pinCnt--;</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;      <span class="keywordflow">if</span> (dirty)</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        bufDescTable[frameNo].dirty = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    }</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="keywordflow">catch</span> (<a class="code" href="classbadgerdb_1_1_hash_not_found_exception.html">HashNotFoundException</a> &amp;e)</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;  }</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#acc61d1985720411ebb76e70f702827d3">  146</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#acc61d1985720411ebb76e70f702827d3">BufMgr::flushFile</a>(<span class="keyword">const</span> <a class="code" href="classbadgerdb_1_1_file.html">File</a> *file)</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;  {</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    <a class="code" href="classbadgerdb_1_1_buf_desc.html">BufDesc</a> *tmpbuf;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="keywordflow">for</span> (std::uint32_t i = 0; i &lt; numBufs; i++)</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    {</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;      tmpbuf = &amp;(bufDescTable[i]);</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;      <span class="keywordflow">if</span> (tmpbuf-&gt;file != file)</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;      <span class="keywordflow">if</span> (tmpbuf-&gt;pinCnt)</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="classbadgerdb_1_1_page_pinned_exception.html">PagePinnedException</a>(file-&gt;<a class="code" href="classbadgerdb_1_1_file.html#af16040a60f18c99305348077ac9e8aa8">filename</a>(), tmpbuf-&gt;pageNo, tmpbuf-&gt;frameNo);</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;      <span class="keywordflow">if</span> (!tmpbuf-&gt;valid)</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="classbadgerdb_1_1_bad_buffer_exception.html">BadBufferException</a>(tmpbuf-&gt;frameNo, tmpbuf-&gt;dirty, tmpbuf-&gt;valid, tmpbuf-&gt;refbit);</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;      <span class="keywordflow">if</span> (tmpbuf-&gt;dirty)</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;      {</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        tmpbuf-&gt;file-&gt;writePage(<a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[i]);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        tmpbuf-&gt;dirty = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;      }</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;      hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a5739cc2b22c74d62e25c9d3d316144d8">remove</a>(tmpbuf-&gt;file, tmpbuf-&gt;pageNo);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;      tmpbuf-&gt;Clear();</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    }</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  }</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#ab9ae3b12aac55b119b5763e3de2a4d2b">  168</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#ab9ae3b12aac55b119b5763e3de2a4d2b">BufMgr::allocPage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a> *file, <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> &amp;pageNo, <a class="code" href="classbadgerdb_1_1_page.html">Page</a> *&amp;page)</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  {</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> frameNo;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    allocBuf(frameNo);</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[frameNo] = file-&gt;<a class="code" href="classbadgerdb_1_1_file.html#a7d0e047bcc8dc4cee36aac5b2060bbe3">allocatePage</a>();</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    page = &amp;(<a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[frameNo]);</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    pageNo = <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>[frameNo].<a class="code" href="classbadgerdb_1_1_page.html#af8416fd0be779f473c97b47e797e1c53">page_number</a>();</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a92480d460ddb07e8b04ab7f99107e334">insert</a>(file, pageNo, frameNo);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    bufDescTable[frameNo].Set(file, pageNo);</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  }</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#a870a80a0f0abcf3b640b913b46b64486">  179</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a870a80a0f0abcf3b640b913b46b64486">BufMgr::disposePage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a> *file, <span class="keyword">const</span> <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> PageNo)</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;  {</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> frameNo;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <span class="keywordflow">try</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;      hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a23b1030dd244d0d956176a596aae0210">lookup</a>(file, PageNo, frameNo);</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;      bufDescTable[frameNo].Clear();</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;      hashTable-&gt;<a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html#a5739cc2b22c74d62e25c9d3d316144d8">remove</a>(file, PageNo);</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    }</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keywordflow">catch</span> (<a class="code" href="classbadgerdb_1_1_hash_not_found_exception.html">HashNotFoundException</a> &amp;e)</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    {</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    }</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    file-&gt;<a class="code" href="classbadgerdb_1_1_file.html#a829a68ccfbeb0c9f66f3a2db7e0b99fe">deletePage</a>(PageNo);</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;  }</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#a598b3112b8193af603f5bc97c478a671">  194</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a598b3112b8193af603f5bc97c478a671">BufMgr::printSelf</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  {</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <a class="code" href="classbadgerdb_1_1_buf_desc.html">BufDesc</a> *tmpbuf;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordtype">int</span> validFrames = 0;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="keywordflow">for</span> (std::uint32_t i = 0; i &lt; numBufs; i++)</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    {</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;      tmpbuf = &amp;(bufDescTable[i]);</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;      std::cout &lt;&lt; <span class="stringliteral">&quot;FrameNo:&quot;</span> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;      tmpbuf-&gt;Print();</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160; </div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;      <span class="keywordflow">if</span> (tmpbuf-&gt;valid == <span class="keyword">true</span>)</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        validFrames++;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    }</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;Total Number of Valid Frames:&quot;</span> &lt;&lt; validFrames &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  }</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_aa498047fc351652d0bc7eabf6cb62ab0"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">badgerdb::BufMgr::bufPool</a></div><div class="ttdeci">Page * bufPool</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00205">buffer.h:205</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_hash_tbl_html"><div class="ttname"><a href="classbadgerdb_1_1_buf_hash_tbl.html">badgerdb::BufHashTbl</a></div><div class="ttdoc">Hash table class to keep track of pages in the buffer pool.</div><div class="ttdef"><b>Definition:</b> <a href="buf_hash_tbl_8h_source.html#l00045">bufHashTbl.h:45</a></div></div>
<div class="ttc" id="anamespacebadgerdb_html"><div class="ttname"><a href="namespacebadgerdb.html">badgerdb</a></div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00017">buffer.cpp:17</a></div></div>
<div class="ttc" id="anamespacebadgerdb_html_a1e7378fbefaea050a47e6cde929e9c01"><div class="ttname"><a href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">badgerdb::FrameId</a></div><div class="ttdeci">std::uint32_t FrameId</div><div class="ttdoc">Identifier for a frame in buffer pool.</div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.html#l00025">types.h:25</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_acc61d1985720411ebb76e70f702827d3"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#acc61d1985720411ebb76e70f702827d3">badgerdb::BufMgr::flushFile</a></div><div class="ttdeci">void flushFile(const File *file)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00146">buffer.cpp:146</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html_a9a1b3cc43c4631bde58c1c4f670e1036"><div class="ttname"><a href="classbadgerdb_1_1_file.html#a9a1b3cc43c4631bde58c1c4f670e1036">badgerdb::File::writePage</a></div><div class="ttdeci">void writePage(const Page &amp;new_page)</div><div class="ttdef"><b>Definition:</b> <a href="file_8cpp_source.html#l00169">file.cpp:169</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_desc_html"><div class="ttname"><a href="classbadgerdb_1_1_buf_desc.html">badgerdb::BufDesc</a></div><div class="ttdoc">Class for maintaining information about buffer pool frames.</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00023">buffer.h:23</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html_a829a68ccfbeb0c9f66f3a2db7e0b99fe"><div class="ttname"><a href="classbadgerdb_1_1_file.html#a829a68ccfbeb0c9f66f3a2db7e0b99fe">badgerdb::File::deletePage</a></div><div class="ttdeci">void deletePage(const PageId page_number)</div><div class="ttdef"><b>Definition:</b> <a href="file_8cpp_source.html#l00184">file.cpp:184</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a870a80a0f0abcf3b640b913b46b64486"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a870a80a0f0abcf3b640b913b46b64486">badgerdb::BufMgr::disposePage</a></div><div class="ttdeci">void disposePage(File *file, const PageId PageNo)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00179">buffer.cpp:179</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html_a7d0e047bcc8dc4cee36aac5b2060bbe3"><div class="ttname"><a href="classbadgerdb_1_1_file.html#a7d0e047bcc8dc4cee36aac5b2060bbe3">badgerdb::File::allocatePage</a></div><div class="ttdeci">Page allocatePage()</div><div class="ttdef"><b>Definition:</b> <a href="file_8cpp_source.html#l00084">file.cpp:84</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_page_html_af8416fd0be779f473c97b47e797e1c53"><div class="ttname"><a href="classbadgerdb_1_1_page.html#af8416fd0be779f473c97b47e797e1c53">badgerdb::Page::page_number</a></div><div class="ttdeci">PageId page_number() const</div><div class="ttdef"><b>Definition:</b> <a href="page_8h_source.html#l00193">page.h:193</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html"><div class="ttname"><a href="classbadgerdb_1_1_file.html">badgerdb::File</a></div><div class="ttdoc">Class which represents a file in the filesystem containing database pages.</div><div class="ttdef"><b>Definition:</b> <a href="file_8h_source.html#l00073">file.h:73</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_hash_tbl_html_a5739cc2b22c74d62e25c9d3d316144d8"><div class="ttname"><a href="classbadgerdb_1_1_buf_hash_tbl.html#a5739cc2b22c74d62e25c9d3d316144d8">badgerdb::BufHashTbl::remove</a></div><div class="ttdeci">void remove(const File *file, const PageId pageNo)</div><div class="ttdef"><b>Definition:</b> <a href="buf_hash_tbl_8cpp_source.html#l00086">bufHashTbl.cpp:86</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_hash_tbl_html_a92480d460ddb07e8b04ab7f99107e334"><div class="ttname"><a href="classbadgerdb_1_1_buf_hash_tbl.html#a92480d460ddb07e8b04ab7f99107e334">badgerdb::BufHashTbl::insert</a></div><div class="ttdeci">void insert(const File *file, const PageId pageNo, const FrameId frameNo)</div><div class="ttdef"><b>Definition:</b> <a href="buf_hash_tbl_8cpp_source.html#l00048">bufHashTbl.cpp:48</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a18b7cf23b619c7c0e593d1dc45da77b4"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a18b7cf23b619c7c0e593d1dc45da77b4">badgerdb::BufMgr::BufMgr</a></div><div class="ttdeci">BufMgr(std::uint32_t bufs)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00020">buffer.cpp:20</a></div></div>
<div class="ttc" id="anamespacebadgerdb_html_a1f49e404293bf4240756b89b53b1587a"><div class="ttname"><a href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">badgerdb::PageId</a></div><div class="ttdeci">std::uint32_t PageId</div><div class="ttdoc">Identifier for a page in a file.</div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.html#l00015">types.h:15</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_aa9bdf04c8543f59744db22efa9420c89"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#aa9bdf04c8543f59744db22efa9420c89">badgerdb::BufMgr::unPinPage</a></div><div class="ttdeci">void unPinPage(File *file, const PageId PageNo, const bool dirty)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00129">buffer.cpp:129</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_ab9ae3b12aac55b119b5763e3de2a4d2b"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#ab9ae3b12aac55b119b5763e3de2a4d2b">badgerdb::BufMgr::allocPage</a></div><div class="ttdeci">void allocPage(File *file, PageId &amp;PageNo, Page *&amp;page)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00168">buffer.cpp:168</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_page_html"><div class="ttname"><a href="classbadgerdb_1_1_page.html">badgerdb::Page</a></div><div class="ttdoc">Class which represents a fixed-size database page containing records.</div><div class="ttdef"><b>Definition:</b> <a href="page_8h_source.html#l00107">page.h:107</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html_af16040a60f18c99305348077ac9e8aa8"><div class="ttname"><a href="classbadgerdb_1_1_file.html#af16040a60f18c99305348077ac9e8aa8">badgerdb::File::filename</a></div><div class="ttdeci">const std::string &amp; filename() const</div><div class="ttdef"><b>Definition:</b> <a href="file_8h_source.html#l00179">file.h:179</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_bad_buffer_exception_html"><div class="ttname"><a href="classbadgerdb_1_1_bad_buffer_exception.html">badgerdb::BadBufferException</a></div><div class="ttdoc">An exception that is thrown when a buffer is found whose valid is false but other variables in BufDes...</div><div class="ttdef"><b>Definition:</b> <a href="bad__buffer__exception_8h_source.html#l00020">bad_buffer_exception.h:20</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_hash_tbl_html_a23b1030dd244d0d956176a596aae0210"><div class="ttname"><a href="classbadgerdb_1_1_buf_hash_tbl.html#a23b1030dd244d0d956176a596aae0210">badgerdb::BufHashTbl::lookup</a></div><div class="ttdeci">void lookup(const File *file, const PageId pageNo, FrameId &amp;frameNo)</div><div class="ttdef"><b>Definition:</b> <a href="buf_hash_tbl_8cpp_source.html#l00070">bufHashTbl.cpp:70</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_aab08001e1be18bfbd4af9113e91cf953"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#aab08001e1be18bfbd4af9113e91cf953">badgerdb::BufMgr::~BufMgr</a></div><div class="ttdeci">~BufMgr()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00039">buffer.cpp:39</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_hash_not_found_exception_html"><div class="ttname"><a href="classbadgerdb_1_1_hash_not_found_exception.html">badgerdb::HashNotFoundException</a></div><div class="ttdoc">An exception that is thrown when an entry being looked up in the hash table is not present in it.</div><div class="ttdef"><b>Definition:</b> <a href="hash__not__found__exception_8h_source.html#l00020">hash_not_found_exception.h:20</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html_a343b7fb1a238992f02454e9e81837acd"><div class="ttname"><a href="classbadgerdb_1_1_file.html#a343b7fb1a238992f02454e9e81837acd">badgerdb::File::readPage</a></div><div class="ttdeci">Page readPage(const PageId page_number) const</div><div class="ttdef"><b>Definition:</b> <a href="file_8cpp_source.html#l00149">file.cpp:149</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_page_not_pinned_exception_html"><div class="ttname"><a href="classbadgerdb_1_1_page_not_pinned_exception.html">badgerdb::PageNotPinnedException</a></div><div class="ttdoc">An exception that is thrown when a page which is expected to be pinned in the buffer pool is found to...</div><div class="ttdef"><b>Definition:</b> <a href="page__not__pinned__exception_8h_source.html#l00020">page_not_pinned_exception.h:20</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a598b3112b8193af603f5bc97c478a671"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a598b3112b8193af603f5bc97c478a671">badgerdb::BufMgr::printSelf</a></div><div class="ttdeci">void printSelf()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00194">buffer.cpp:194</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a9f853f0f1d4628e7e14374d0c7c6a4f3"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a9f853f0f1d4628e7e14374d0c7c6a4f3">badgerdb::BufMgr::readPage</a></div><div class="ttdeci">void readPage(File *file, const PageId PageNo, Page *&amp;page)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00109">buffer.cpp:109</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_page_pinned_exception_html"><div class="ttname"><a href="classbadgerdb_1_1_page_pinned_exception.html">badgerdb::PagePinnedException</a></div><div class="ttdoc">An exception that is thrown when a page which is not expected to be pinned in the buffer pool is foun...</div><div class="ttdef"><b>Definition:</b> <a href="page__pinned__exception_8h_source.html#l00020">page_pinned_exception.h:20</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
